package com.school;

import java.util.Scanner;

public class Test1Case1 {
    public static void main(String[] args) {
        //输入数字
        String num;
        while (true) {
            Scanner sc=new Scanner(System.in);
            num=sc.next();
            //判断输入是否合法
            boolean flag=check(num);
            if(flag){
                break;
            }else{
                System.out.println("输入错误");
                continue;
            }
        }
        //将数字转换为罗马数字
        StringBuilder sb=new StringBuilder();
        for(int i=0;i<num.length();i++){
            char c=num.charAt(i);
            int number=c-48;//将字符转换为数字
            String s=changeLuoMa(number);
            sb.append(s);
        }
        System.out.println(sb);
    }

    public static String changeLuoMa(int number){
        String[] arr={"","一","二","三","四","五","六","七","八","九"};
        return arr[number];
    }


    public static  boolean check(String num){
        if(num.length()>9){
            return false;
        }
        for(int i=0;i<num.length();i++){
            char c=num.charAt(i);
            if(num.charAt(i)>'9'||num.charAt(i)<'0'){
                return false;
            }
        }
        //当所有字符都是数字时，返回true
        return true;

    }



}
